<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<div class="block">
    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        
        <h2>Permissions for "<bean:write name="group" property="groupName"/>" group</h2>
        
    </div>
    <!-- .block_head ends -->

    <html:form action="admin/permission.do" method="post">
    
        <div class="block_content clearfix">
            <logic:notEmpty name="errorMessage" >
                <div class="message errormsg"><p><bean:write name="errorMessage"/></p></div>
            </logic:notEmpty>
            <logic:notEmpty name="successMessage" >
                <div class="message success"><p><bean:write name="successMessage"/></p></div>
            </logic:notEmpty>
            <table cellpadding="0" cellspacing="0" width="100%" class="sortable">
                
                <thead>
                    <tr>
                        <td width="100"><input type="checkbox" class="check_all"/></td>
                        <th>Permissions</th>
                    </tr>
                </thead>
                
                <tbody>
                    <html:hidden property="groupID"/>
                    <logic:empty name="permissionsTable">
                        <tr>
                            <td class="align-center" colspan="2">There are no permissions</td>
                        </tr>
                    </logic:empty>
                    <logic:notEmpty name="permissionsTable">
                        <logic:iterate id="permission" name="permissionsTable">
                            <tr>
                                <td>
                                    <html:multibox property="modules" value="${permission[0]}"  />
                                </td>
                                <td>
                                    ${permission[1]}
                                </td>
                            </tr>
                        </logic:iterate>
                    </logic:notEmpty>
                </tbody>
                
            </table>
    
    
    <html:submit property="action" value="Save" styleClass="submit small"/>
    <html:submit property="action" value="Save & Exit" styleClass="submit mid"/>
    <html:link action="/admin/permissionListing.do" styleClass="submit small gray">Cancel</html:link>
        </div>
        <!-- .block_content ends -->
    
    </html:form>
    <div class="bendl"></div>
    <div class="bendr"></div>
</div>
<!-- .block ends -->